<div className="layui-form" lay-filter="layuiadmin-form-rule" style="padding: 20px 30px 0 0;">
  <div className="layui-form-item">
<!--    <label className="layui-form-label">上级规则</label>-->
    <div className="layui-input-inline">
      <script type="text/html" template>
        <input type="hidden" name="pidh" id="pidh" value="{{ d.params.rulePid || '' }}"/>
        </select>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">规则ID</label>
    <div class="layui-input-inline">

      <script type="text/html" template>
        <input type="text" name="cname" value="{{ d.params.ruleName || '' }}" lay-verify="required" placeholder="请输入规则名称" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">等级ID</label>
    <div class="layui-input-inline">

      <script type="text/html" template>
        <input type="text" name="levelId" value="{{ d.params.levelId || '' }}" lay-verify="required" placeholder="请输入等级ID" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">作品ID</label>
    <div class="layui-input-inline">

      <script type="text/html" template>
        <input type="text" name="worksId" value="{{ d.params.worksId || '' }}" lay-verify="required" placeholder="请输入作品ID" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">规则计数</label>
    <div class="layui-input-inline">

      <script type="text/html" template>
        <input type="number" name="ruleCount" value="{{ d.params.ruleCount || '' }}" lay-verify="required" placeholder="请输入规则计数" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">规则年限</label>
    <div class="layui-input-inline">

      <script type="text/html" template>
        <input type="number" name="ruleYears" value="{{ d.params.ruleYears || '' }}" lay-verify="required" placeholder="请输入规则年限" autocomplete="off" class="layui-input">
      </script>
    </div>
  </div>
<!--  <div className="layui-form-item">-->
<!--    <label className="layui-form-label">规则备注</label>-->
<!--    <div className="layui-input-inline">-->
<!--      <input type="hidden" name="ruleMemo" value="{{ d.params.ruleMemo || '' }}" placeholder="请输入规则备注"-->
<!--             autoComplete="off" className="layui-input">-->
<!--    </div>-->
<!--  </div>-->
  <div class="layui-form-item" lay-filter="cflag">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <script type="text/html" template>
        <input type="radio" name="cflag" value="0" title="启用" {{ d.params.departmentFlag === '启用' ? 'checked' : '' }} checked>
        <input type="radio" name="cflag" value="1" title="禁用" {{ d.params.departmentFlag === '禁用' ? 'checked' : '' }}>
      </script>
    </div>
  </div>
    <div class="layui-form-item">
      <label class="layui-form-label"></label>
      <div class="layui-input-inline">
        <input type="button" lay-submit lay-filter="LAY-department-add" value="确认" class="layui-btn">
      </div>
    </div>
</div>

<script>
  layui.use(['admin', 'form'], function () {
    var $ = layui.$
            , form = layui.form;

  });
  layui.use(['form', 'layer'], function () {
    var $ = layui.$;
    var form = layui.form, layer = layui.layer;
    //加载外键1
    $.ajax({
      url: '/getRulesServlet',
      dataType: 'json', //服务器返回json格式数据
      type: 'post', //HTTP请求类型
      timeout: 10000, //超时时间设置为10秒；
      success: function (data) {
        $.each(data.data, function (index, value) {
        });
        form.render("select");
      }
    });
  });
</script>